package no10;

import java.util.ArrayList;
import java.util.List;

public class xueshentest {
    public static void main(String[] args) {
        ArrayList<xueshen> list = new ArrayList<>();

        list.add(new xueshen(1, "张三"));
        list.add(new xueshen(2, "李四"));
        list.add(new xueshen(3, "王五"));


        System.out.println(list);
        for (int i = 0; i < list.size(); i++) {
            xueshen xueshen = list.get(i);
            if (xueshen.getName().equals("张三")) {
                xueshen.setName("张三丰");
            }

            if (xueshen.getName().equals("王五")) {
                list.remove(xueshen);
            }
        }

        System.out.println(list);
    }
}
